<?php $GLOBALS['script'][] = function() {?><script>
vue.data.disabled = 0;
vue.data.form.username = '';
vue.data.form.qquin = '';
vue.data.form.qquin2 = '';
vue.methods.submit = function () {
    const that = this;
    const form = window.clone(that.form);
    if (form.qquin !== form.qquin2) {
        alert('两次填写的QQ号码不一致');
        return;
    }
    that.disabled++;
    var urlPath = '/panel/yun/ntuser/add';
    that.ApiPost(urlPath, form).then(function (res) {
    }, function (res) {
        console.log('reject:', res);
    }).then(function (res) {
        that.disabled--;
        that.email_focus = true;
    }).catch(function (reason) {
        that.disabled--;
        console.log('catch:', reason);
    })
};
</script><?php }?>

<div class="row">
    <div class="col-xs-12 col-sm-8 col-md-6 col-lg-6">
        <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">新建远程桌面账号</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" action="" method="post" v-on:submit="submit" onsubmit="return false;">
              <div class="box-body">
                <div class="form-group">
                  <label for="username" class="col-sm-3 control-label">远程桌面账号</label>
                  <div class="col-sm-9">
                    <input type="text" class="form-control"
                    id="username"
                    v-model="form.username"
                    :disabled="disabled>0"
                    placeholder="只能由26个英文字母组成，最少6位">
                  </div>
                </div>
                <div class="form-group">
                  <label for="qquin" class="col-sm-3 control-label">绑定QQ号码</label>
                  <div class="col-sm-9">
                    <input type="text" class="form-control"
                    id="qquin"
                    v-model="form.qquin"
                    :disabled="disabled>0"
                    placeholder="请正确填写，申请后无法修改。">
                  </div>
                </div>
                <div class="form-group">
                  <label for="qquin2" class="col-sm-3 control-label">再次确认QQ号码</label>
                  <div class="col-sm-9">
                    <input type="text" class="form-control"
                    id="qquin2"
                    v-model="form.qquin2"
                    :disabled="disabled>0"
                    placeholder="请正确填写，申请后无法修改。">
                  </div>
                </div>
                <div class="form-group">
                  <label for="qquin2" class="col-sm-3 control-label">使用范围声明</label>
                  <div class="col-sm-9">
                    <div class="form-control" style="color:red">
                      请确认您已了解飞儿云不支持安装手机模拟器和任何3D版游戏。
                    </div>
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <button type="submit" class="btn btn-info pull-right" :disabled="disabled>0">提交</button>
              </div>
              <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>
